import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
import type { App } from 'vue'
import zhCn from 'element-plus/es/locale/lang/zh-cn'

export function setupElementPlus(app: App) {
  // 注册所有图标
  for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
    app.component(key, component)
  }

  // 使用 Element Plus
  app.use(ElementPlus, {
    locale: zhCn,
  })
}
